package main

import (
	"fmt"
	"math"
)

type ErrNegariveSqrt float64

func (e ErrNegariveSqrt) Error() string{

	return fmt.Sprintf("cannot Sqrt negative number: %v", float64(e))
}

func Sqrt(x float64) (float64, error) {

	if x<0 {
		return 0, ErrNegariveSqrt(x)
	}
	return math.Sqrt(x),nil

}

func main() {
	fmt.Println(Sqrt(2))
	fmt.Println(Sqrt(-2))
}
